package com.chaodev.base.dao;

import com.chaodev.base.model.DataPageVO;
import com.chaodev.base.model.UserInfo;
import com.chaodev.base.model.wenjuan.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * vcbase
 *
 * @author 95634
 * @描述
 * @date 2023/5/23 16:00
 **/
@Mapper
public interface WenJuanDao {
    List<Paper> examPaperQuery(@Param("cUser") String c);

    /**
     * @description:检查试题名称是否重复
     * @param userInfo
     * @return
     */
    int isExist(UserInfo userInfo);

    int isAnswer(Answer answer);

    int insertData(Paper wenJuan);
    /**
     * 更新问卷表实体对象
     * @param paper
     * @return
     */
    void updateDataById(Paper paper);

    Paper editExamPaper(@Param(value = "id") String id);

    List<Map<String,Object>> editExamPapers(@Param(value = "id") String id);

    List<Map<String,Object>> myExamPaperQuery(DataPageVO dataPageVO);

    int submitWenJuan(List<PaperFinsh> paperFinsh);
    int submitWenJuanScore(UserScore userScore);

    int saveQuestion(Question question);

    int updateQuestion(Question question);

    int savePaperQuestion(PaperQuestion paperQuestion);

    int saveAnswer(Answer answer);

    int saveAnswers(List<Answer> answer);

    int updateAnswer(Answer answer);

    int updateSql(@Param(value = "qId") Integer qId);

    List<UserScore> getUserScoreList(UserScore userScore);
    List<Map<String,Object>> getPaperInfo(DataPageVO dataPageVO);

    int setBindPaper(@Param(value = "paperId") String paperId);

    int effectivePaper(@Param(value = "paperId") String paperId);

    Answer selectAnswerById(@Param(value = "id") String id);

    PaperQuestion selectPaperQuestionDetail(PaperQuestion paperQuestion);

    int deletePaperQuestion(@Param(value = "id") String id);

    Integer paperQuestion(@Param(value = "id") String id);

    /**
     * 删除问卷表实体对象
     * @param id
     * @return
     */
    int deleteDataById(@Param(value = "id") String id);

    int insertExamPaper(PaperDepart paperDepart);

    int updateExamPaper(PaperDepart paperDepart);

    Paper getExamPaper(@Param("id") String id);

    int bindPaper(List<PaperDepart> paperDeparts);

    List<Map<String,Object>> checkBing(Map<String,Object> map);

    void getPaPerScoreResult(Map<String,Object> map);
}
